//
//  FilesOperation.m
//  StarGroup
//
//  资源文件和存储文件的获取和操作
//
//  Created by APPYING on 14-6-20.
//  Copyright (c) 2014年 APPYING. All rights reserved.
//

#import "FilesOperation.h"

@interface FilesOperation ()

@end

@implementation FilesOperation

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

+ (NSString *)returnDocumentsFileAddress:(NSString *)fileName {
    //获取应用程序沙盒的Documents目录
    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
    NSString *plistPath = [paths objectAtIndex:0];
    //得到完整的文件名
    return [plistPath stringByAppendingPathComponent:fileName];
}

+ (NSString *)returnResourceFileAddress:(NSString *)fileName andTyeo:(NSString *)type {
    return [[NSBundle mainBundle] pathForResource:fileName ofType:type];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
